Skip to content

Lint: fix CSS syntax and some antipatterns #39685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025
Merged

Conversation

Josh-Cena
Copy link
Member

  • Fix some obvious syntax errors
  • clip never supported rect without commas; remove that syntax
  • Removed some redundant property duplications
  • Removed other redeclarations for the purpose of browser compatibility, because the newer syntax is well-supported already
  • Rewrote the @media not description because it's incorrect

@Josh-Cena Josh-Cena requested review from a team as code owners May 26, 2025 12:58
@Josh-Cena Josh-Cena requested review from estelle and sideshowbarker and removed request for a team May 26, 2025 12:58
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs Content:WebAPI Web API docs Content:Learn Learning area docs Content:Accessibility Accessibility docs Content:Media Media docs size/m [PR only] 51-500 LoC changed labels May 26, 2025
Copy link
Contributor

Preview URLs (27 pages)
Flaws (10)

Note! 23 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Learn_web_development/Extensions/Forms/HTML_forms_in_legacy_browsers
Title: HTML forms in legacy browsers
Flaw count: 3

  • unknown:
    • No generic content config found
    • no blog root
    • no blog root

URL: /en-US/docs/Web/API/Web_Audio_API/Controlling_multiple_parameters_with_ConstantSourceNode
Title: Controlling multiple parameters with ConstantSourceNode
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Web/API/Web_Audio_API/Tools which is a redirect

URL: /en-US/docs/Web/API/WebRTC_API/Build_a_phone_with_peerjs/Setup
Title: Setup
Flaw count: 1

  • macros:
    • Can't resolve /en-US/docs/Web/API/RTCDtlsTransport/statechange_event

URL: /en-US/docs/Web/CSS/@supports
Title: @supports
Flaw count: 5

  • broken_links:
    • Can't resolve /en-US/docs/Web/CSS/rule-list
    • Can't resolve /en-US/docs/Web/CSS/function-token
    • Can't resolve /en-US/docs/Web/CSS/any-value
    • Can't resolve /en-US/docs/Web/CSS/any-value
    • Can't resolve /en-US/docs/Web/CSS/declaration
External URLs (27)

URL: /en-US/docs/Learn_web_development/Core/Frameworks_libraries/React_todo_list_beginning
Title: Beginning our React ToDo app


URL: /en-US/docs/Learn_web_development/Extensions/Forms/How_to_build_custom_form_controls
Title: How to build custom form controls


URL: /en-US/docs/Web/CSS/-webkit-text-stroke
Title: -webkit-text-stroke


URL: /en-US/docs/Web/CSS/left
Title: left


URL: /en-US/docs/Web/Media/Guides/Audio_and_video_delivery/Adding_captions_and_subtitles_to_HTML5_video
Title: Adding captions and subtitles to HTML video

@Josh-Cena Josh-Cena requested review from bsmth and removed request for a team May 26, 2025 13:03
Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one page needs fixin'.

Thanks!

@@ -169,7 +169,7 @@ The `.boxLeft` class, used to style the box on the left, sets up the color of th
background-color: hwb(270deg 63% 13%);
outline: 4px dashed #6e1478;
color: hsl(0deg 100% 100%);
text-decoration: underline;
text-decoration-line: underline;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we have 3 long hands then the shorthand. Safari doesn't understand thickness in the shorthand, but this value doesn't include that property, so we can just use the shorthand and get ride of the note after this block

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also remove "along with the longhand component for browser compatibility" before
'We used the 3-digit {{cssxref("hex-color")}} #8f8, which is the equivalent of #88ff88.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@estelle Unfortunately the latest Safari still does not support this. Note that in the text-decoration BCD table, "text-decoration-color and text-decoration-style included in shorthand" for Safari says "Implemented with the vendor prefix: -webkit-". I've tried on Safari 18.5.

@bsmth bsmth removed request for sideshowbarker and bsmth May 27, 2025 11:50
@estelle estelle merged commit edb16c0 into mdn:main May 27, 2025
7 checks passed
@Josh-Cena Josh-Cena deleted the fix-css-lint branch May 28, 2025 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Accessibility Accessibility docs Content:CSS Cascading Style Sheets docs Content:Learn Learning area docs Content:Media Media docs Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants